package net.wanho.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Author：汤小洋
 * Date：2025-02-17 11:22
 * Description：<描述>
 */
@Configuration
public class GatewayConfig {

    @Bean
    public RouteLocator routeLocator(RouteLocatorBuilder builder){
        RouteLocatorBuilder.Builder routes = builder.routes();

        // routes.route("users_route",
        //         p -> p.path("/api/v2/user/**")
        //                 .filters(f -> f.stripPrefix(2))
        //                 .uri("lb://user-provider"));
        return routes.build();
    }

}
